import subprocess
import time

###############################################################################


def executeCommand( command ):
    
    commands = []
    commands.append( command )
    
    commandLine = subprocess.Popen(
        commands,
        shell = True,
        stdout = subprocess.PIPE,
        stderr = subprocess.PIPE
    )
    
    result = None
    while ( result == None ):
        result = commandLine.poll()
        time.sleep( 0.1 )

    out = commandLine.stdout.read()    
    err = commandLine.stderr.read()

    return out, err, result


###############################################################################
